'''
@author: haiwen
@date: 2020/9/27
@file: conftest.py
'''
import pytest

from pylib.webapi.business import AccountsAPI
#签约对象-VIP客户
@pytest.fixture(scope='package')
def init_accounts(init_organiz):
    org_api=init_organiz[0]
    org=init_organiz[1]#部门
    #创建签约对象
    accounts_api=AccountsAPI(org_api.cookies)
    accounts=accounts_api.add(name='VIP-客户',company_ids=[org['_id']])
    yield accounts_api,accounts
    accounts_api.delete(accounts['_id']) #清除数据
